package com.qdlc.p2p.manage.action;

import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.annotation.Resource;

import com.qdlc.p2p.biz.core.tender.BorrowStrategyContextFactory;
import com.qdlc.p2p.biz.util.excel.ExcelUtils;
import com.qdlc.p2p.biz.util.excel.JsGridReportBase;
import com.qdlc.p2p.biz.util.excel.TableData;
import com.qdlc.p2p.common.constant.*;
import com.qdlc.p2p.common.constant.RealNameStatus;
import com.qdlc.p2p.dal.dao.BorrowTenderDao;
import com.qdlc.p2p.dal.dto.*;
import org.apache.struts2.convention.annotation.Action;

import com.opensymphony.xwork2.ModelDriven;
import com.qdlc.p2p.biz.service.BorrowConfigService;
import com.qdlc.p2p.biz.service.BorrowMortgageService;
import com.qdlc.p2p.biz.service.BorrowService;
import com.qdlc.p2p.biz.service.BorrowTenderService;
import com.qdlc.p2p.biz.service.BorrowUploadService;
import com.qdlc.p2p.biz.service.EnjoyBorrowService;
import com.qdlc.p2p.biz.service.EnjoyGoodsService;
import com.qdlc.p2p.biz.service.OperationLogService;
import com.qdlc.p2p.biz.service.UserIdentifyService;
import com.qdlc.p2p.biz.service.UserService;
import com.qdlc.p2p.biz.service.borrow.BorrowFullVerifyService;
import com.qdlc.p2p.biz.util.FileTypeUtil;
import com.qdlc.p2p.biz.util.HclientFileUtil;
import com.qdlc.p2p.biz.web.action.BaseAction;
import com.qdlc.p2p.common.enums.EnumUploadImgType;
import com.qdlc.p2p.common.exception.BorrowException;
import com.qdlc.p2p.common.exception.BusinessException;
import com.qdlc.p2p.common.exception.UserException;
import com.qdlc.p2p.common.util.BigDecimalUtil;
import com.qdlc.p2p.common.util.DateUtil;
import com.qdlc.p2p.common.util.MessageUtil;
import com.qdlc.p2p.common.util.StringUtil;
import com.qdlc.p2p.common.util.UploadFileUtil;
import com.qdlc.p2p.dal.common.SystemConfigHelper;
import com.qdlc.p2p.dal.common.SystemConfigHelper.Nid;
import com.qdlc.p2p.dal.common.model.jpa.PageDataList;
import com.qdlc.p2p.dal.common.model.jpa.QueryParam;
import com.qdlc.p2p.dal.dao.BorrowDao;
import com.qdlc.p2p.dal.model.BorrowModel;
import com.qdlc.p2p.dal.model.BorrowTenderModel;
import com.qdlc.p2p.dal.util.UserUtils;

/**
 * 借款管理-借款管理
 *
 * @author cx
 * @version 2.0
 * @since 2014-5-14
 */
public class ManageBorrowAction extends BaseAction<BorrowModel> implements ModelDriven<BorrowModel> {

	@Resource
	private BorrowService borrowService;

	@Resource
	private BorrowConfigService borrowConfigService;

	@Resource
	private BorrowTenderService borrowTenderService;

	@Resource
	private OperationLogService operationLogService;

	@Resource
	private UserService userService;

	@Resource
	private UserIdentifyService userIdentifyService;

	@Resource
	private BorrowMortgageService borrowMortgageService;

	@Resource
	private BorrowUploadService borrowUploadService;

	@Resource
	private BorrowFullVerifyService borrowFullVerifyService;

    @Resource
    private EnjoyGoodsService enjoyGoodsService;

    @Resource
    private EnjoyBorrowService enjoyBorrowService;
    
	@Resource
	private BorrowDao borrowDao;

	@Resource
	private BorrowTenderDao borrowTenderDao;

	private Map<String, Object> data = new HashMap<String, Object>();
	private long[] ids; // 要更新的抵押物ID
	private long[] delIds; // 删除的图片ID
	private long[] delMortgageIds; // 删除的抵押物ID
	private double[] assessPrice;
	private double[] mortgagePrice;
	private String[] carNo;
	private String[] carType;

	private File contract; //获取后台手动上传借款合同

	private String contractContentType;//获取文件类型

	private String contractFileName;

	/**
	 * <p>标展示</p>
	 * @author 原系统 2016年2月1日 下午6:49:13
	 * @return
	 * @throws Exception
	 * @modificationHistory=========================逻辑或功能性重大变更记录
	 * @modify by user: Kaiju Zhao 2016年2月1日 下午6:49:13
	 * @modify by reason: 规范代码
	 */
	@Action("/modules/loan/borrow/borrowManager")
	public String borrowManager() throws Exception {
		List<BorrowConfig> borrowConfigList = borrowConfigService.findAll();
		request.setAttribute("borrowConfigList", borrowConfigList);
		request.setAttribute(DataConstant.WEB_URL, SystemConfigHelper.getValue(Nid.WEB_URL));
		return "borrowManager";
	}

	/**
	 * <p>标列表</p>
	 * @author 原系统 2016年2月1日 下午6:49:13
	 * @throws Exception
	 * @modificationHistory=========================逻辑或功能性重大变更记录
	 * @modify by user: Kaiju Zhao 2016年2月1日 下午6:49:13
     * @modify by reason: 规范代码
	 */
	@Action("/modules/loan/borrow/borrowList")
	public void borrowList() throws Exception {
		String status = paramString("status");
		if (StringUtil.isNotBlank(status)) {
		    int statusInt = Integer.parseInt(status);
			if (BorrowStatus.STATUS_AUTO_TENDER_DONE == statusInt) {
				model.setScales(BorrowScales.HUNDRED_PERCENT);
				model.setStatus(BorrowStatus.STATUS_TRIAL_PASSED);
			} else {
				model.setStatus(statusInt);
			}
		} else {
			model.setStatus(BorrowStatus.STATUS_UNKNOWN);
		}
		PageDataList<BorrowModel> list = borrowService.manageList(model);
		data.put(DataConstant.TOTAL, list.getPage().getTotal());
		data.put(DataConstant.ROWS, list.getList());
		printJson(getStringOfJpaObj(data));
	}

	/**
	 * 初审中的借款-页面
	 *
	 * @return String
	 * @throws Exception
	 *             if has error
	 */
	@Action("/modules/loan/borrow/verifyBorrowManager")
	public String verifyBorrowManager() throws Exception {
		List<BorrowConfig> borrowConfigList = borrowConfigService.findAll();
		request.setAttribute("borrowConfigList", borrowConfigList);
		return "verifyBorrowManager";
	}

	/**
	 * <p>初审中的借款-列表</p>
	 * @author Kaiju Zhao 2016年2月1日 下午7:02:03
	 * @throws Exception
	 * @modificationHistory=========================逻辑或功能性重大变更记录
	 * @modify by user: Kaiju Zhao 2016年2月1日 下午7:02:03
	 * @modify by reason: 规范代码
	 */
	@Action("/modules/loan/borrow/verifyBorrowList")
	public void verifyBorrowList() throws Exception {
		model.setStatus(BorrowStatus.STATUS_PUBLISHING);
		PageDataList<BorrowModel> list = borrowService.manageList(model);
		data.put(DataConstant.TOTAL, list.getPage().getTotal());
	    data.put(DataConstant.ROWS, list.getList());
		printJson(getStringOfJpaObj(data));
	}

	/**
	 * 已登记待确认的借款-页面
	 *
	 * @return String
	 * @throws Exception
	 *             if has error
	 */
	@Action("/modules/loan/borrow/registeredBorrowManager")
	public String registeredBorrowManager() throws Exception {
		List<BorrowConfig> borrowConfigList = borrowConfigService.findAll();
		request.setAttribute("borrowConfigList", borrowConfigList);
		return "registeredBorrowManager";
	}

	/**
	 * <p>已登记待确认的借款-列表</p>
	 * @author 原系统 2016年2月1日 下午7:04:23
	 * @throws Exception
	 * @modificationHistory=========================逻辑或功能性重大变更记录
	 * @modify by user: Kaiju Zhao 2016年2月1日 下午7:04:23
	 * @modify by reason: 规范代码
	 */
	@Action("/modules/loan/borrow/registeredBorrowList")
	public void registeredBorrowList() throws Exception {
		model.setStatus(BorrowStatus.STATUS_REGISTRATE_DOING);
		PageDataList<BorrowModel> list = borrowService.list(model);
		data.put(DataConstant.TOTAL, list.getPage().getTotal());
        data.put(DataConstant.ROWS, list.getList());
		printJson(getStringOfJpaObj(data));
	}

	/**
	 * 已确认待初审的借款-页面
	 *
	 * @return String
	 * @throws Exception
	 *             if has error
	 */
	@Action("/modules/loan/borrow/confirmedBorrowManager")
	public String confirmedBorrowManager() throws Exception {
		List<BorrowConfig> borrowConfigList = borrowConfigService.findAll();
		request.setAttribute("borrowConfigList", borrowConfigList);
		return "confirmedBorrowManager";
	}

	/**
	 * <p>已确认待初审的借款-列表</p>
	 * @author 原系统 2016年2月1日 下午7:06:32
	 * @throws Exception
	 * @modificationHistory=========================逻辑或功能性重大变更记录
	 * @modify by user: Kaiju Zhao 2016年2月1日 下午7:06:32
	 * @modify by reason: 规范代码
	 */
	@Action("/modules/loan/borrow/confirmedBorrowList")
	public void confirmedBorrowList() throws Exception {
	    model.setStatus(BorrowStatus.STATUS_PUBLISHING);
		PageDataList<BorrowModel> list = borrowService.manageList(model);
		data.put(DataConstant.TOTAL, list.getPage().getTotal());
        data.put(DataConstant.ROWS, list.getList());
		printJson(getStringOfJpaObj(data));
	}

	/**
	 * 添加标页面
	 *
	 * @return String
	 * @throws Exception
	 *             if has error
	 */
	@Action("/modules/loan/borrow/borrowAddPage")
	public String borrowAddPage() throws Exception {
		List<User> vouchFirms = userService.getVouchFirms();
		request.setAttribute("vouchFirms", vouchFirms);
		request.setAttribute("typeId", paramString("type"));
        BorrowConfig borrowConfig = (BorrowConfig) Global.getBorrowConfig(model.getType());
        request.setAttribute("manageFee", borrowConfig == null ? 0 : borrowConfig.getManageFee());
        request.setAttribute("dayManageFee", borrowConfig == null ? 0 : borrowConfig.getDayManageFee());
        saveToken("borrowAddPageToken");
		return "borrowAddPage";
	}

	/**
	 * 后台添加标
	 *
	 * @throws Exception
	 *             if has error
	 */
	@Action("/modules/loan/borrow/addBorrow")
	public void addBorrow() throws Exception {
		// checkToken("borrowAddPageToken");
		User user = userService.getUserByMobilePhone(paramString("mobile"));
		if (null == user) {
		    throw new UserException("不存在该借款用户", BusinessException.TYPE_JSON);
        }
		UserCache userCache = UserUtils.getUserCacheByUserId(user);
		if (null == userCache
		        || UserType.INVESTOR == userCache.getUserType()) {
			throw new UserException("不存在该借款用户", BusinessException.TYPE_JSON);
		}
		UserIdentify ui = userIdentifyService.getUserIdentifyByUserId(user.getUserId());
		String tppUserCustId = UserUtils.getUserTppCustId(user.getUserId());
		if (RealNameStatus.AUTHENTICATED_PASS != ui.getRealNameStatus()
		        || StringUtil.isBlank(tppUserCustId)) {
			throw new UserException("该用户未实名认证", BusinessException.TYPE_JSON);
		}
		if(UserType.INVESTMENT_BORROWER == userCache.getUserType()){
			if(!borrowService.checkUserTenderList(user.getUserId())){
				throw new UserException("该用户还有未完成的投标", BusinessException.TYPE_JSON);
			}
		}
		try {
			model.validBorrowStyle();
			model.validBorrow();
			// 验证定向标
			model.validDXB();
			// 新增奖励设置
			model.checkAward();
			//0元购判断是否发标总额为最低金额的整数倍
			if(model.getType()==BorrowType.DELIVER_GOODS){
				if(model.getAccount()%model.getLowestAccount()>0){
					throw new BorrowException("该标借款总金额必须是最低投标金额的整数倍", BusinessException.TYPE_JSON);
				}
			}
			//判断是否需要担保
			String vouch = request.getParameter("vouch");
			if (vouch == null) {
				model.setVouchFirm(null);
				model.setGuaranteeRate(0);
			} else {
                BorrowConfig borrowConfig = (BorrowConfig) Global.getBorrowConfig(model.getType());
                if (borrowConfig != null) {
                    if (model.getGuaranteeRate() > borrowConfig.getManageFee()) {
                        throw new BorrowException("担保费率不能大于借款管理费", BusinessException.TYPE_JSON);
                    }
                } else if (BigDecimalUtil.round(model.getGuaranteeFee()) == 0) {
                    throw new BorrowException("担保费总额四舍五入计算结果为0", BusinessException.TYPE_JSON);
                }
			}
			List<BorrowUpload> list = new ArrayList<BorrowUpload>();
			//if (model.getType() != Borrow.TYPE_SECOND) {
				// 获得上传图片字符串数组
				String[] picPaths = request.getParameterValues("picPath");
				if (picPaths == null) {
					throw new BorrowException("图片不能为空", BusinessException.TYPE_JSON);
				}
				for (String picPath : picPaths) {
					BorrowUpload bu = new BorrowUpload();
					bu.setPicPath(picPath);
					bu.setType(BorrowUploadType.FLOW_DATA);
					list.add(bu);
				}

				String[] thumbnailPaths = request.getParameterValues("thumbnailPicPath");
				if (null != thumbnailPaths
						&& thumbnailPaths.length > 0) {
					for (String picPath : thumbnailPaths) {
						BorrowUpload bu = new BorrowUpload();
						bu.setPicPath(picPath);
						bu.setType(BorrowUploadType.THUMBNAIL);
						list.add(bu);
					}
				}

				if (model.getBorrowManageRate() == 0){
                    BorrowConfig borrowConfig = (BorrowConfig) Global.getBorrowConfig(model.getType());
                    double manageRate = borrowConfig == null ? 0 : borrowConfig.getManageFee();
                    model.setBorrowManageRate(manageRate);
				}
			String isRecommend = request.getParameter("isRecommend");
			if("1".equals(isRecommend)){
				model.setRecommend(true);
			}
			//}
			borrowService.save(model, user, list);
			printResult("添加成功", true);
		} catch (Exception e) {
			throw new RuntimeException(e.getMessage(), e);
		}
	}

	/**
	 * 修改标页面
	 *
	 * @return String
	 * @throws Exception
	 *             if has error
	 */
	@Action("/modules/loan/borrow/borrowUpdatePage")
	public String borrowUpdatePage() throws Exception {
		long id = paramLong("id");
		List<BorrowUpload> picList = borrowService.findPicByBorrowId(id);
		request.setAttribute("picList", picList);
		List<User> vouchFirms = userService.getVouchFirms();
		request.setAttribute("vouchFirms", vouchFirms);
		Borrow borrow = borrowService.getBorrowById(id);
		request.setAttribute("isRecommend", borrow.isRecommend()?1:0);
		request.setAttribute("borrow", borrow);
		request.setAttribute("user", borrow.getUser());
		BorrowModel model = BorrowModel.instance(borrow);
		request.setAttribute("borrow", model);
        BorrowConfig borrowConfig = (BorrowConfig) Global.getBorrowConfig(model.getType());
        request.setAttribute("manageFee", borrowConfig == null ? 0 : borrowConfig.getManageFee());
        request.setAttribute("dayManageFee", borrowConfig == null ? 0 : borrowConfig.getDayManageFee());
		return "borrowUpdatePage";
	}

	/**
	 * 后台修改标
	 *
	 * @throws Exception
	 *             if has error
	 */
	@Action("/modules/loan/borrow/updateBorrow")
	public void updateBorrow() throws Exception {
		//判断是否需要担保
		String vouch = request.getParameter("vouch");
		if (vouch == null) {
			model.setVouchFirm(null);
			model.setGuaranteeRate(0);
		} else {
            BorrowConfig borrowConfig = (BorrowConfig) Global.getBorrowConfig(model.getType());
            double manageFee = borrowConfig == null ? 0 : borrowConfig.getManageFee();
            if (model.getGuaranteeRate() > manageFee) {
                throw new BorrowException("担保费率不能大于借款管理费");
            }
        }
		Borrow oldBorrow = borrowService.find(model.getId());
		if (oldBorrow.getStatus() != BorrowStatus.STATUS_PUBLISHING && oldBorrow.getCategory() != 2) {// 排除体验标
			throw new BorrowException("该标已经初审通过，不能修改");
		}
		User user = oldBorrow.getUser();
		model.validBorrowStyle();
		List<BorrowUpload> list = new ArrayList<BorrowUpload>();
		String[] picPaths = request.getParameterValues("picPath");
		if (picPaths != null) {
			for (String picPath : picPaths) {
				BorrowUpload bu = new BorrowUpload();
				bu.setBorrow(oldBorrow);
				bu.setPicPath(picPath);
				bu.setType(4);
				list.add(bu);
			}
		}

		String[] thumbnailPaths = request.getParameterValues("thumbnailPath");
		if (thumbnailPaths != null) {
			for (String picPath : thumbnailPaths) {
				BorrowUpload bu = new BorrowUpload();
				bu.setBorrow(oldBorrow);
				bu.setPicPath(picPath);
				bu.setType(6);
				list.add(bu);
			}
		}

		List<BorrowMortgage> borrowMortgageList = null;
		if (model.getBorrowManageRate() == 0){
            BorrowConfig borrowConfig = (BorrowConfig) Global.getBorrowConfig(model.getType());
            double manageRate = borrowConfig == null ? 0 : borrowConfig.getManageFee();
            model.setBorrowManageRate(manageRate);
		}
		if("1".equals(request.getParameter("isRecommend")))
			model.setRecommend(true);
		borrowService.updateLoan(model, user, oldBorrow, list, borrowMortgageList, delIds, delMortgageIds);
		printResult("修改成功", true);
	}

	/**
	 * 后台上传
	 *
	 * @throws Exception
	 *             if has error
	 */
	@Action("/modules/loan/borrow/uploadBorrowPic")
	public void uploadBorrowPic() throws Exception {
		String picPath = imgUpload(EnumUploadImgType.BORROW.getValue());
		data.put("picPath", picPath);
		printJson(getStringOfJpaObj(data));
	}

	/**
	 * 删除上传的图片
	 *
	 * @throws Exception
	 */
	@Action("/modules/loan/borrow/deleteBorrowPic")
	public void deleteBorrowPic() throws Exception {
		if (paramInt("id") == 0) {
			String picPath = paramString("picPath");
			/*String realPath = ServletActionContext.getServletContext().getRealPath(picPath);
			new File(realPath).delete();*/
			String url = UploadFileUtil.getMessage("deleteUrl");
			HclientFileUtil.deleteImg(url, picPath);
			printWebSuccess();
		}
	}

	/**
	 * 标登记
	 *
	 * @return
	 * @throws Exception
	 *             if has error
	 */
	@Action("/modules/loan/borrow/registerBorrow")
	public String registerBorrow() throws Exception {
		long id = paramLong("id");
		Borrow borrow = borrowService.find(id);
		if (borrow.getStatus() != 9 && borrow.getStatus() != 0) {
			throw new BusinessException("标状态异常，请刷新后重新操作", "/home.html");
		}
		String name = SystemConfigHelper.getValue(Nid.COOPERATION_INTERFACE);
		borrowService.update(borrow);
		return name + "Borrow";
	}

	/**
	 * 标结束
	 *
	 * @return
	 * @throws Exception
	 *             if has error
	 */
	@Action("/modules/loan/borrow/cancelBorrowSkip")
	public String cancelBorrowSkip() throws Exception {
		long id = paramLong("id");
		Borrow borrow = borrowService.find(id);
		OperationLog log = new OperationLog(borrow.getUser(), getOperator(),
				"stop_flow");
		log.setOperationResult("用户名为" + getOperator().getUserName() + "（"
				+ Global.getIP() + "）的操作员对用户为" + borrow.getUser().getUserName()
				+ "的借款标（ID:" + borrow.getId() + ",标名为" + borrow.getName()
				+ "）进行撤标操作");
		operationLogService.save(log, borrow);
		//User user = borrow.getUser();
		borrow.setStatus(-1);
		/*String name = Global.getValue("cooperation_interface");
		TPPWay way = TPPFactory.getTPPWay(null, user, null, null, borrow);
		Object depositBorrow = way.doCancelBorrow(borrow);
		request.setAttribute(name+"Borrow", depositBorrow);
		return name + "Borrow";*/
		return "";
	}

	/**
	 * 标登记结果
	 *
	 * @throws Exception
	 *             if has error
	 */
	@Action("/modules/loan/borrow/registerBorrowResult")
	public void registerBorrowResult() throws Exception {
		try {
			long id = paramLong("id");
			Borrow borrow = borrowService.find(id);
			if (borrow.getStatus() != BorrowStatus.STATUS_PUBLISHING) {
				printResult("标登记成功", true);
			} else {
				printResult("标登记失败！", false);
			}
		} catch (Exception e) {
			printResult("标登记失败！", false);
		}
	}

	/**
	 * 初审中的借款-标初审页面
	 *
	 * @return String
	 * @throws Exception
	 *             if has error
	 */
	@Action("/modules/loan/borrow/borrowVerifyPage")
	public String borrowVerifyPage() throws Exception {
		Borrow borrow = borrowService.find(model.getId());
		List<BorrowUpload> picList = borrowService.findPicByBorrowId(model.getId());
		request.setAttribute("picList", picList);
		request.setAttribute("borrow", borrow);
		request.setAttribute("isRecommend", borrow.isRecommend()?"是":"否");
		request.setAttribute("user", borrow.getUser());
		saveToken("borrowVerifyToken");
		return "borrowVerifyPage";
	}

	/**
	 * 初审中的借款-标初审页面-标准
	 *
	 * @return String
	 * @throws Exception
	 *             if has error
	 */
	@Action("/modules/loan/borrow/borrowVerifyPageBz")
	public String borrowVerifyPageBz() throws Exception {
		Borrow borrow = borrowService.find(model.getId());
		List<BorrowUpload> picList = borrowService.findPicByBorrowId(model.getId());
		request.setAttribute("picList", picList);
		request.setAttribute("borrow", borrow);
		request.setAttribute("isRecommend", borrow.isRecommend()?"是":"否");
		request.setAttribute("user", borrow.getUser());
		saveToken("borrowVerifyTokenBz");
		return "borrowVerifyPageBz";
	}

	/**
	 * 初审中的借款-标初审操作
	 *
	 * @throws Exception
	 *             if has error
	 */
	@Action("/modules/loan/borrow/borrowVerify")
	public void borrowVerify() throws Exception {
		checkToken("borrowVerifyToken");
		model.setPreStatus(0);
		borrowService.verify(model, getOperator());
		printResult(MessageUtil.getMessage("I10009"), true);
	}

	/**
	 * 初审中的借款-标初审操作-标准
	 *
	 * @throws Exception
	 *             if has error
	 */
	@Action("/modules/loan/borrow/borrowVerifyBz")
	public void borrowVerifyBz() throws Exception {
		checkToken("borrowVerifyTokenBz");
		borrowService.verifyBz(model, getOperator());
		printResult(MessageUtil.getMessage("I10009"), true);
	}

	/**
	 * 满标待审的招标-页面
	 *
	 * @return String
	 * @throws Exception
	 *             if has error
	 */
	@Action("/modules/loan/borrow/verifyFullBorrowManager")
	public String verifyFullBorrowManager() throws Exception {
		List<BorrowConfig> borrowConfigList = borrowConfigService.findAll();
		request.setAttribute("borrowConfigList", borrowConfigList);
		return "verifyFullBorrowManager";
	}

	/**
     * <p>满标待审的招标-标列表</p>
     * @author 原系统 2016年2月1日 下午3:26:43
     * @return
     * @throws Exception
     * @modificationHistory=========================逻辑或功能性重大变更记录
     * @modify by user: Kaiju Zhao 2016年2月1日 下午3:26:43
     * @modify by reason: 改用静态常量
     */
	@Action("/modules/loan/borrow/verifyFullBorrowList")
	public void verifyFullBorrowList() throws Exception {
		model.setStatus(BorrowStatus.STATUS_TRIAL_PASSED);
		model.setScales(BorrowScales.HUNDRED_PERCENT);
		PageDataList<BorrowModel> list = borrowService.manageList(model);
		data.put(DataConstant.TOTAL, list.getPage().getTotal());
		data.put(DataConstant.ROWS, list.getList());
		printJson(getStringOfJpaObj(data));
	}

	/**
	 * <p>满标复审页面</p>
	 * @author 原系统 2016年2月1日 下午3:26:43
	 * @return
	 * @throws Exception
	 * @modificationHistory=========================逻辑或功能性重大变更记录
	 * @modify by user: Kaiju Zhao 2016年2月1日 下午3:26:43
	 * @modify by reason: 将token字符串改成静态常量
	 */
	@Action("/modules/loan/borrow/verifyFullBorrowPage")
	public String verifyFullBorrowPage() throws Exception {
		Borrow borrow = borrowService.find(model.getId());
		request.setAttribute("borrow", borrow);
		request.setAttribute("isRecommend", borrow.isRecommend() ? "是" : "否");
		request.setAttribute("user", borrow.getUser());
		saveToken(TokenConstant.VERIFY_FULL_BORROW_TOKEN);
		return "verifyFullBorrowPage";
	}

	/**
	 * PS 满标复审
	 * @author 原系统 2016年2月1日 下午3:28:23
	 * @throws Exception
	 * @modificationHistory=========================逻辑或功能性重大变更记录
	 * @modify by user: Kaiju Zhao 2016年2月1日 下午3:26:43
     * @modify by reason: 规范代码
	 */
	@Action("/modules/loan/borrow/verifyFullBorrow")
    public void verifyFullBorrow() throws Exception {
        checkToken(TokenConstant.VERIFY_FULL_BORROW_TOKEN);
        boolean checkContract = checkFileTrueType();
        if (!checkContract) {
			throw new BorrowException("不能改变上传文件的类型!", BorrowException.TYPE_JSON);
        }
		borrowFullVerifyService.verifyFull(model, getOperator(), contract);
        printResult(MessageUtil.getMessage("I10009"), true);
    }

	/**
	 * 根据标名称获得标的详情
	 *
	 * @return String
	 * @throws Exception
	 *             if has error
	 */
	@Action("/modules/loan/borrow/borrowDetailPage")
	public String borrowDetailPage() throws Exception {
		long id = paramLong("id");
		Borrow borrow = borrowService.getBorrowById(id);
		request.setAttribute("borrow", borrow);
		request.setAttribute("isRecommend", borrow.isRecommend()?"是":"否");
		request.setAttribute("user", borrow.getUser());
		return "borrowDetailPage";
	}

	/**
	 * 招标中的借款
	 *
	 * @return String
	 * @throws Exception
	 *             if has error
	 */
	@Action("/modules/loan/borrow/borrowBiddingManager")
	public String borrowBiddingManager() throws Exception {
		List<BorrowConfig> borrowConfigList = borrowConfigService.findAll(); // 查询所有的标种
		request.setAttribute("borrowConfigList", borrowConfigList);
		return "borrowBiddingManager";
	}

	/**
	 * 招标中的借款列表 status=1
	 *
	 * @throws Exception
	 *             if has error
	 */
	@Action("/modules/loan/borrow/borrowBiddingList")
	public void borrowBiddingList() throws Exception {
		model.setStatus(1); //标记为招标中的借款
		PageDataList<BorrowModel> pageDataList = borrowService.getList(model);
		data.put("total", pageDataList.getPage().getTotal());
		data.put("rows", pageDataList.getList());
		printJson(getStringOfJpaObj(data));
	}

	/**
	 * 招标中的借款标（投标记录页面）
	 *
	 * @return String
	 * @throws Exception
	 *             if has error
	 */
	@Action("/modules/loan/borrow/tenderDetailPage")
	public String tenderDetailPage() throws Exception {
		request.setAttribute("id", model.getId());
		return "tenderDetailPage";
	}

	/**
	 * 招标中的借款标（投标记录列表）
	 *
	 * @throws Exception
	 *             if has error
	 */
	@Action("/modules/loan/borrow/tenderDetailList")
	public void tenderDetailList() throws Exception {
		PageDataList<BorrowTenderModel> pageDataList = borrowTenderService
				.list(model.getBorrowId(), model.getPage(), paramInt("rows"));
		data.put("total", pageDataList.getPage().getTotal());
		data.put("rows", pageDataList.getList());
		printJson(getStringOfJpaObj(data));
	}

	/**
	 * 招标中的借款 -查看
	 *
	 * @return String
	 * @throws Exception
	 *             if has error
	 */
	@Action("/modules/loan/borrow/showBorrowDetailPage")
	public String showBorrowDetailPage() throws Exception {
		Borrow borrow = borrowService.find(model.getId());
		request.setAttribute("flow", paramString("flow"));
		request.setAttribute("borrow", borrow);
		request.setAttribute("isRecommend", borrow.isRecommend() ? "是" : "否");
		request.setAttribute("borrowUser", borrow.getUser().getUserName());
		return "showBorrowDetailPage";
	}

	/**
	 * 招标中的借款 -推荐
	 *
	 * @throws Exception
	 *             if has error
	 */
	@Action("/modules/loan/borrow/recommendBorrow")
	public void recommendBorrow() throws Exception {
		Borrow borrow = borrowService.find(model.getId());
		borrow.setRecommend(true);
		borrowService.update(borrow);
		printResult("推荐成功！", true);
	}

	/**
	 * 招标中的借款 -取消推荐
	 *
	 * @throws Exception
	 *             if has error
	 */
	@Action("/modules/loan/borrow/unRecommendBorrow")
	public void unRecommendBorrow() throws Exception {
		Borrow borrow = borrowService.find(model.getId());
		borrow.setRecommend(false);
		borrowService.update(borrow);
		printResult("推荐成功！", true);
	}
	/**
	 * 招标中的借款 -截标页面
	 *
	 * @return String
	 * @throws Exception
	 *             if has error
	 */
	@Action("/modules/loan/borrow/stopBorrowPage")
	public String stopBorrowPage() throws Exception {
		Borrow borrow = borrowService.find(model.getId());
		request.setAttribute("flow" , paramString("flow"));
		request.setAttribute("borrow", borrow);
		request.setAttribute("isRecommend", borrow.isRecommend()?"是":"否");
		request.setAttribute("borrowUser", borrow.getUser().getUserName());
		return "stopBorrowPage";
	}

	/**
	 * 招标中的借款 -截标（将招标金额改为已招标金额）
	 *
	 * @throws Exception
	 *             if has error
	 */
	@Action("/modules/loan/borrow/stopBorrow")
	public void stopBorrow() throws Exception {
		Borrow borrow = borrowService.find(model.getId());
		borrowService.stopBorrow(borrow);

		OperationLog log = new OperationLog(borrow.getUser(), getOperator(),
				"stop_borrow");
		log.setOperationResult("用户名" + getOperator().getUserName() + "（"
				+ Global.getIP() + "）的操作员对用户为" + borrow.getUser().getUserName()
				+ "的借款标（ID:" + borrow.getId() + ",标名为" + borrow.getName()
				+ "）进行截标操作");
		operationLogService.save(log);
		printResult("截标成功！", true);
	}

	/**
	 * 招标中的借款 -停止流转页面
	 *
	 * @return String
	 * @throws Exception
	 *             if has error
	 */
	@Action("/modules/loan/borrow/stopFlowPage")
	public String stopFlowPage() throws Exception {
		Borrow borrow = borrowService.find(model.getId());
		request.setAttribute("borrow", borrow);
		request.setAttribute("isRecommend", borrow.isRecommend()?"是":"否");
		request.setAttribute("borrowUser", borrow.getUser().getUserName());
		return "stopFlowPage";
	}

	/**
	 * 招标中的借款 -流转标停止流转
	 *
	 * @throws Exception
	 *             if has error
	 */
	@Action("/modules/loan/borrow/stopFlow")
	public void stopFlow() throws Exception {
		Borrow borrow = borrowService.find(model.getId());
		borrow.setStatus(8);
		borrowService.update(borrow);
		OperationLog log = new OperationLog(borrow.getUser(), getOperator(),
				"stop_flow");
		log.setOperationResult("用户名为" + getOperator().getUserName() + "（"
				+ Global.getIP() + "）的操作员对用户为" + borrow.getUser().getUserName()
				+ "的借款标（ID:" + borrow.getId() + ",标名为" + borrow.getName()
				+ "）进行停止流转操作");
		operationLogService.save(log);
		printResult("操作成功！", true);
	}

	/**
	 * 流标的借款（有效期内为投满的标）-页面
	 *
	 * @return String
	 * @throws Exception
	 *             if has error
	 */
	@Action("/modules/loan/borrow/showSpreadBorrowManager")
	public String showSpreadBorrowManager() throws Exception {
		List<BorrowConfig> borrowConfigList = borrowConfigService.findAll();
		request.setAttribute("borrowConfigList", borrowConfigList);
		return "showSpreadBorrowManager";
	}

	/**
	 * 已登记待确认--取消
	 *
	 * @throws Exception
	 *             if has error
	 */
	@Action("/modules/loan/borrow/borrowCancel")
	public void borrowCancel() throws Exception {
		Borrow borrow = borrowService.find(model.getId());
		borrowService.borrowCancel(borrow);
		OperationLog log = new OperationLog(borrow.getUser(), getOperator(),
				"cancel_borrow");
		log.setOperationResult("用户名为" + getOperator().getUserName() + "（"
				+ Global.getIP() + "）的操作员对用户为" + borrow.getUser().getUserName()
				+ "的借款标（ID:" + borrow.getId() + ",标名为" + borrow.getName()
				+ "）进行取消操作");
		operationLogService.save(log);
		printResult("取消借款标成功！", true);
	}

	/**
	 * 招标中的借款-撤回页面
	 *
	 * @return String
	 * @throws Exception
	 *             if has error
	 */
	@Action("/modules/loan/borrow/cancelBorrowPage")
	public String cancelBorrowPage() throws Exception {
		Borrow borrow = borrowService.find(model.getId());
		request.setAttribute("flow" , paramString("flow"));
		request.setAttribute("borrow", borrow);
		request.setAttribute("borrowUser", borrow.getUser().getUserName());
		return "cancelBorrowPage";
	}

	/**
	 * 招标中的借款-撤回操作
	 *
	 * @throws Exception
	 *             if has error
	 */
	@Action("/modules/loan/borrow/cancelBorrow")
	public void cancelBorrow() throws Exception {
		Borrow borrow = borrowService.find(model.getId());
		borrowService.cancel(borrow);
		OperationLog log = new OperationLog(borrow.getUser(), getOperator(), "stop_flow");
		log.setOperationResult("用户名为" + getOperator().getUserName() + "（"
				+ Global.getIP() + "）的操作员对用户为" + borrow.getUser().getUserName()
				+ "的借款标（ID:" + borrow.getId() + ",标名为" + borrow.getName()
				+ "）进行撤标操作");
		operationLogService.save(log);
		printResult("撤回借款标成功！", true);
	}

	/**
	 * 添加抵押物页面
	 *
	 * @throws Exception
	 *             if has error
	 */
	@Action("/modules/loan/borrow/addMortgagePage")
	public String addMortgagePage() throws Exception {
		request.setAttribute("id", model.getId());
		return "addMortgagePage";
	}

	/**
	 * 添加抵押物
	 *
	 * @throws Exception
	 *             if has error
	 */
	@Action("/modules/loan/borrow/addMortgage")
	public void addMortgage() throws Exception {
		Borrow borrow = borrowService.find(model.getId());
		int num = borrowMortgageService
				.getMaxNumByBorrowId(model.getBorrowId());
		List<BorrowUpload> list = new ArrayList<BorrowUpload>();
		List<BorrowMortgage> borrowMortgageList = model.getBorrowMortgageList();
		if (borrowMortgageList == null) {
			throw new BorrowException("至少上传一个抵押物！", 1);
		}
		for (int i = 0; i < borrowMortgageList.size(); i++) {
			BorrowMortgage borrowMortgage = borrowMortgageList.get(i);
			borrowMortgage.setBorrow(borrow);
			borrowMortgage.setStatus(1);
			borrowMortgage.setNum(num + 1);
			borrowMortgage.setAddIp(Global.getIP());
			borrowMortgage.setAddTime(DateUtil.getNow());
			borrowMortgageList.set(i, borrowMortgage);
			if (borrowMortgage.getAssessPrice() <= borrowMortgage
					.getMortgagePrice()) {
				throw new BorrowException("评估价必须大于抵押价！", 1);
			}
			String[] physicalPicPaths = request
					.getParameterValues("physicalPicPath" + i);
			if (physicalPicPaths == null) {
				throw new BusinessException("必须上传至少一张实物照！", 1);
			}
			for (String physicalPicPath : physicalPicPaths) {
				BorrowUpload bu = new BorrowUpload();
				bu.setBorrow(borrow);
				bu.setBorrowMortgage(model.getBorrowMortgageList().get(i));
				bu.setPicPath(physicalPicPath);
				bu.setType(BorrowUploadType.MORTGAGE_PHYSICAL);
				list.add(bu);
			}
			String[] archivesPicPaths = request
					.getParameterValues("archivesPicPath" + i);
			if (archivesPicPaths == null) {
				throw new BusinessException("必须上传至少一张档案照！", 1);
			}
			for (String archivesPicPath : archivesPicPaths) {
				BorrowUpload bu = new BorrowUpload();
				bu.setBorrow(borrow);
				bu.setBorrowMortgage(model.getBorrowMortgageList().get(i));
				bu.setPicPath(archivesPicPath);
				bu.setType(BorrowUploadType.MORTGAGE_ARCHIVES);
				list.add(bu);
			}
		}
		borrowMortgageService.addMortgage(borrowMortgageList, list);
		printResult("添加资产包成功！", true);
	}

	/**
	 * 获取要更新的抵押物页面
	 *
	 * @throws Exception
	 *             if has error
	 */
	@Action("/modules/loan/borrow/getUpdateMortgageListPage")
	public String getUpdateMortgageListPage() throws Exception {
		request.setAttribute("id", model.getId());
		List<BorrowMortgage> list = new ArrayList<BorrowMortgage>();
		for (long id : ids) {
			BorrowMortgage borrowMortgage = borrowMortgageService.findById(id);
			if (borrowMortgage.getStatus() != 1) {
				throw new BorrowException("非入库状态的抵押物不能更新");
			}
			list.add(borrowMortgage);
		}
		request.setAttribute("list", list);
		return "getUpdateMortgageListPage";
	}

	/**
	 * 更新资产包操作
	 *
	 * @throws Exception
	 *             if has error
	 */
	@Action("/modules/loan/borrow/updateBorrowCollateral")
	public void updateBorrowCollateral() throws Exception {

		Borrow borrow = borrowService.find(model.getBorrowId());
		int num = borrowMortgageService
				.getMaxNumByBorrowId(model.getBorrowId());
		List<BorrowUpload> list = new ArrayList<BorrowUpload>();
		List<BorrowMortgage> bms = new ArrayList<BorrowMortgage>();
		List<BorrowMortgage> borrowMortgageList = model.getBorrowMortgageList();
		if (borrowMortgageList == null) {
			throw new BorrowException("至少上传一个抵押物！", 1);
		}
		double inPrice = 0;
		for (int i = 0; i < borrowMortgageList.size(); i++) {
			BorrowMortgage borrowMortgage = borrowMortgageList.get(i);
			inPrice = BigDecimalUtil.add(inPrice,
					borrowMortgage.getMortgagePrice());
			borrowMortgage.setBorrow(borrow);
			borrowMortgage.setStatus(1);
			borrowMortgage.setNum(num + 1);
			borrowMortgage.setAddIp(Global.getIP());
			borrowMortgage.setAddTime(DateUtil.getNow());
			borrowMortgageList.set(i, borrowMortgage);
			if (borrowMortgage.getAssessPrice() <= borrowMortgage
					.getMortgagePrice()) {
				throw new BorrowException("评估价必须大于抵押价！", 1);
			}
			String[] physicalPicPaths = request
					.getParameterValues("physicalPicPath" + i);
			if (physicalPicPaths == null) {
				throw new BusinessException("必须上传至少一张实物照！", 1);
			}
			for (String physicalPicPath : physicalPicPaths) {
				BorrowUpload bu = new BorrowUpload();
				bu.setBorrow(borrow);
				bu.setBorrowMortgage(model.getBorrowMortgageList().get(i));
				bu.setPicPath(physicalPicPath);
				bu.setType(BorrowUploadType.MORTGAGE_PHYSICAL);
				list.add(bu);
			}
			String[] archivesPicPaths = request
					.getParameterValues("archivesPicPath" + i);
			if (archivesPicPaths == null) {
				throw new BusinessException("必须上传至少一张档案照！", 1);
			}
			for (String archivesPicPath : archivesPicPaths) {
				BorrowUpload bu = new BorrowUpload();
				bu.setBorrow(borrow);
				bu.setBorrowMortgage(model.getBorrowMortgageList().get(i));
				bu.setPicPath(archivesPicPath);
				bu.setType(BorrowUploadType.MORTGAGE_ARCHIVES);
				list.add(bu);
			}
		}
		double totalMortgagePrice = borrowMortgageService
				.getTotalMortgagePriceByBorrowId(model.getBorrowId());
		double outPrice = 0;
		for (long id : ids) {
			BorrowMortgage bm = borrowMortgageService.findById(id);
			bms.add(bm);
			outPrice = BigDecimalUtil.add(outPrice, bm.getMortgagePrice());
			BorrowMortgage b = new BorrowMortgage();
			b.setStatus(2);
			b.setNum(num + 1);
			b.setAddIp(Global.getIP());
			b.setAddTime(DateUtil.getNow());
			b.setAssessPrice(bm.getAssessPrice());
			b.setMortgagePrice(bm.getMortgagePrice());
			b.setBorrow(bm.getBorrow());
			b.setCarType(bm.getCarType());
			b.setCarNo(bm.getCarNo());
			borrowMortgageList.add(b);
			List<BorrowUpload> bus = borrowUploadService.findByMortgageId(bm
					.getId());
			for (BorrowUpload upload : bus) {
				BorrowUpload bu = new BorrowUpload();
				bu.setBorrow(borrow);
				bu.setBorrowMortgage(b);
				bu.setPicPath(upload.getPicPath());
				bu.setType(upload.getType());
				list.add(bu);
			}
		}
		if (BigDecimalUtil.add(totalMortgagePrice, inPrice, -outPrice) < borrow
				.getAccount()) {
			throw new RuntimeException("更新抵押物后抵押总价不能小于借款总额！");
		}
		borrowMortgageService.updateBorrowMortgage(borrowMortgageList, bms,
				list);
		printResult("更新资产包成功！", true);
	}

	/**
	 * 更新抵押物列表页面
	 *
	 * @return String
	 * @throws Exception
	 *             if has error
	 */
	@Action("/modules/loan/borrow/getMortgageListPage")
	public String getMortgageListPage() throws Exception {
		long id = paramLong("id");
		request.setAttribute("borrow", borrowService.find(id));
		List<BorrowUpload> list = borrowUploadService.findByMortgageId(id);
		request.setAttribute("list", list);
		return "getMortgageListPage";
	}

	/**
	 * 抵押物列表数据
	 *
	 * @throws Exception
	 *             if has error
	 */
	@Action("/modules/loan/borrow/getMortgageList")
	public void getMortgageList() throws Exception {
		long id = paramLong("id");
		List<BorrowMortgage> list = borrowMortgageService.findByBorrowId(id, 1);
		data.put("rows", list);
		printJson(getStringOfJpaObj(data));
	}

	/**
	 * 获取要更新的抵押物列表
	 *
	 * @throws Exception
	 *             if has error
	 */
	@Action("/modules/loan/borrow/getUpdateMortgageList")
	public void getUpdateMortgageList() throws Exception {
		List<BorrowUpload> list = borrowUploadService
				.findByMortgageId(paramLong("id"));
		data.put("list", list);
		printJson(getStringOfJpaObj(data));
	}

	/**
	 * 获取抵押物图片修改页面
	 *
	 * @throws Exception
	 *             if has error
	 */
	@Action("/modules/loan/borrow/getPicPage")
	public String getPicPage() throws Exception {
		request.setAttribute("id", paramString("id"));
		List<BorrowMortgage> list = new ArrayList<BorrowMortgage>();
		for (long id : ids) {
			BorrowMortgage borrowMortgage = borrowMortgageService.findById(id);
			list.add(borrowMortgage);
		}
		request.setAttribute("list", list);
		return "getPicPage";
	}

	/**
	 * 更新图片操作
	 *
	 * @throws Exception
	 *             if has error
	 */
	@Action("/modules/loan/borrow/updatePic")
	public void updatePic() throws Exception {

		Borrow borrow = borrowService.find(model.getBorrowId());
		List<BorrowUpload> list = new ArrayList<BorrowUpload>();
		for (int i = 0; i < ids.length; i++) {
			BorrowMortgage borrowMortgage = borrowMortgageService
					.findById(ids[i]);
			String[] physicalPicPaths = request
					.getParameterValues("physicalPicPath" + i);
			if (physicalPicPaths != null) {
				for (String physicalPicPath : physicalPicPaths) {
					BorrowUpload bu = new BorrowUpload();
					bu.setBorrow(borrow);
					bu.setBorrowMortgage(borrowMortgage);
					bu.setPicPath(physicalPicPath);
					bu.setType(BorrowUploadType.MORTGAGE_PHYSICAL);
					list.add(bu);
				}
			}
			String[] archivesPicPaths = request
					.getParameterValues("archivesPicPath" + i);
			if (archivesPicPaths != null) {
				for (String archivesPicPath : archivesPicPaths) {
					BorrowUpload bu = new BorrowUpload();
					bu.setBorrow(borrow);
					bu.setBorrowMortgage(borrowMortgage);
					bu.setPicPath(archivesPicPath);
					bu.setType(BorrowUploadType.MORTGAGE_ARCHIVES);
					list.add(bu);
				}
			}
		}
		borrowService.updatePic(list, delIds);
		printResult("更新资产包图片成功！", true);
	}

	/**
	 * 获取认证通过的手机列表页面
	 *
	 * @throws Exception
	 *             if has error
	 */
	@Action("/modules/loan/borrow/getMobileListPage")
	public String getEmailListPage() throws Exception {
		return "getMobileListPage";
	}

	/**
	 * 查找已开通第三方支付的企业账户Mobile集合
	 */
	@Action("/modules/loan/borrow/getMobileList")
	public void getMobileList() throws Exception {
		PageDataList<User> pageList = userService.findUserList(model);
		int totalPage = pageList.getPage().getTotal(); // 总条数
		data.put("total", totalPage);
		data.put("rows", pageList.getList());
		printJson(getStringOfJpaObj(data));
	}

	/**
	 * 借款人金额统计
	 *
	 * @throws Exception
	 *             if has error
	 */
	@Action("/modules/loan/borrow/borrowingStatisticsPage")
	public String borrowingStatisticsPage() throws Exception {
		return "borrowingStatisticsPage";
	}

	/**
	 * 投资人数统计页面
	 *
	 * @return
	 * @throws Exception
	 */
	@Action("/modules/loan/borrow/investmentStatisticsPage")
	public String investmentStatisticsPage() throws Exception {
		return "investmentStatisticsPage";
	}

	/**
	 * 校验用户上传文件的真实类型，避免
	 * 出现用户手动修改文件后缀上传信息
	 * @return
	 */
	private boolean checkFileTrueType() throws Exception {
		if (contract != null) {
			String types = FileTypeUtil.getFileByFile(contract); //getFileByFile
			//后台上传合同，只能上传pdf格式的文档，其他的格式拒绝上传
			if (!"pdf".equals(types)) {
				try {
					printResult(MessageUtil.getMessage("I10020"), false);
					return false;
				} catch (IOException e) {
					e.printStackTrace();
				}
			}
		}
		return true;

	}

	/**
	 * 导出报表
	 *
	 * @throws Exception
	 */
	@Action("/modules/loan/borrow/exportExcelBorrow")
	public void exportExcelTender() throws Exception {
		response.setContentType("application/msexcel;charset=UTF-8");
		// 最多出5000条记录
		model.setRows(5000);
		List<BorrowModel> list = borrowService.manageList(model).getList();
		String title = "借款标记录Excel表";
		String[] hearders = new String[] { "编号", "用户名", "借款人", "标名", "类型", "借款金额(元)", "进度（%）", "利率（%）", "期限", "状态","还款方式"};// 表头数组
		String[] fields = new String[] { "id", "userName", "realName", "name", "typeStr", "account",
				"scales", "apr", "timeLimitTip", "statusStr","styleStr" };// 对象属性数组
		TableData td = ExcelUtils.createTableData(list, ExcelUtils.createTableHeader(hearders), fields);
		JsGridReportBase report = new JsGridReportBase(request, response);
		report.exportToExcel(title, getOperator().getUserName(), td);
	}
	
	public long[] getIds() {
		return ids;
	}

	public void setIds(long[] ids) {
		this.ids = ids;
	}

	public long[] getDelIds() {
		return delIds;
	}

	public void setDelIds(long[] delIds) {
		this.delIds = delIds;
	}

	public long[] getDelMortgageIds() {
		return delMortgageIds;
	}

	public void setDelMortgageIds(long[] delMortgageIds) {
		this.delMortgageIds = delMortgageIds;
	}

	public double[] getAssessPrice() {
		return assessPrice;
	}

	public void setAssessPrice(double[] assessPrice) {
		this.assessPrice = assessPrice;
	}

	public double[] getMortgagePrice() {
		return mortgagePrice;
	}

	public void setMortgagePrice(double[] mortgagePrice) {
		this.mortgagePrice = mortgagePrice;
	}

	public String[] getCarNo() {
		return carNo;
	}

	public void setCarNo(String[] carNo) {
		this.carNo = carNo;
	}

	public String[] getCarType() {
		return carType;
	}

	public void setCarType(String[] carType) {
		this.carType = carType;
	}

	public File getContract() {
		return contract;
	}

	public void setContract(File contract) {
		this.contract = contract;
	}

	public String getContractContentType() {
		return contractContentType;
	}

	public void setContractContentType(String contractContentType) {
		this.contractContentType = contractContentType;
	}

	public String getContractFileName() {
		return contractFileName;
	}

	public void setContractFileName(String contractFileName) {
		this.contractFileName = contractFileName;
	}


}
